//
//  ProductFilterItemView.swift
//  weile
//
//  Created by LKM on 16/10/18.
//  Copyright © 2016年 LKM. All rights reserved.
//

import UIKit



class ProductFilterItemView: UIView {
    
    class func createView() ->ProductFilterItemView{
        return Bundle.main.loadNibNamed("ProductFilterItemView", owner: nil, options: nil)!.last as! ProductFilterItemView
    }
    
    @IBOutlet weak var img_t: UIImageView!

    @IBOutlet weak var lbl_title: UILabel!
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        //初始化一下
        isSelect_=false;
        setUnSelect()
        
    }
    
    func isSelect()->Bool{
        return isSelect_;
    }
    private var isSelect_:Bool=false;
    func setSelect(_ b:Bool){
        if(isSelect_==b){
            return;
        }
        if(b){
//            69, 146, 156
            backgroundColor =  UIColor(red: 69/255.0, green: 146/255.0, blue: 156/255.0, alpha: 1)
            lbl_title.textColor=UIColor.white
            img_t.image=#imageLiteral(resourceName: "ic_more_up_lable")
        }else{
           setUnSelect();
        }
        isSelect_ = b
    }
    private func setUnSelect(){
        backgroundColor = UIColor.clear
        lbl_title.textColor=R.colors._333
        img_t.image=#imageLiteral(resourceName: "ic_more_down_lable")
    }
    
    func binData(_ title:String,tag:Any?){
        lbl_title.setText(str: title);
        setTag(&R.id.tag, tag);
        
        
    }
    func getTag() -> Any? {
       return getTag(&R.id.tag);
    }
    
}
